home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SAVESCRN.SWG / 0003_SAVE3.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  31 lines

  1. >---------< How to save/restore the whole screen >----------
  2. {$X+}
  3. Uses Crt;
  4.  
  5. Type PScreenBuf = ^TScreenBuf;
  6.      TScreenBuf = Array [1..2000] of Word;
  7.  
  8. Var ScreenBuf: PScreenBuf;   { Pointer to actual video ram }
  9.     Scr:       TScreenBuf;   { buffer For screen storage   }
  10.     VideoPort: Word Absolute 0:$463;  { the video port adr }
  11.     i:         Byte;         { :-) you'll always find it   }
  12.                              { in Programs like this :-)   }
  13. begin
  14.   if VideoPort = $3D4 then
  15.     ScreenBuf := Ptr ($B800,0)        { oh, it's color :-) }
  16.   else
  17.     ScreenBuf := Ptr ($B000,0);          { oh no, mono :-( }
  18.  
  19.   Scr := ScreenBuf^;                   {*** SAVE SCREEN ***}
  20.  
  21.   if ReadKey=#0 then ReadKey;           { wait For any key }
  22.   For i:=1 to 60 do
  23.     Writeln ('Hello guys out there...');  { DESTROY SCREEN }
  24.   if ReadKey=#0 then ReadKey;           { wait For any key }
  25.  
  26.   ScreenBuf^ := Scr;                {*** REStoRE SCREEN ***}
  27.  
  28.   if ReadKey=#0 then ReadKey;           { wait For any key }
  29. end.
  30. >-----------------< Yes! Even tested! >---------------------
  31.